package www.ld.com.domain.attr.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import www.ld.com.core.group.InsertGroup;
import www.ld.com.core.group.UpdateGroup;
import www.ld.com.dictionary.AttrTypeEnum;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
@Accessors(chain = true)
@ToString
@EqualsAndHashCode
public class InAttrVO {
    @ApiModelProperty(value = "属性Id")
    @NotNull(message = "属性Id",groups = UpdateGroup.class)
    private String id;

    @ApiModelProperty(value = "属性名称")
    @NotBlank(message = "属性名称不能为空")
    @Length(max = 20,min = 2,message = "属性名称必须是{min}~{max}个字符",groups = {UpdateGroup.class, InsertGroup.class})
    private String name;

    @ApiModelProperty(value = "是否需要检索")
    @NotNull(message = "是否需要检索不能为空",groups = {UpdateGroup.class, InsertGroup.class})
    private Boolean searchType;

    @ApiModelProperty(value = "属性图标")
    @Length(max = 255, message = "属性icon图标不能大于{max}个字符",groups = {UpdateGroup.class, InsertGroup.class})
    private String icon;

    @ApiModelProperty(value = "可选值")
    @Length(max = 255, message = "可选值不能大于{max}个字符",groups = {UpdateGroup.class, InsertGroup.class})
    private String valueSelect;

    @ApiModelProperty(value = "属性类型")
    @NotNull(  message = "属性类型不能为空",groups = {UpdateGroup.class, InsertGroup.class})
    private AttrTypeEnum attrType;

    @ApiModelProperty(value = "启用状态")
    @NotNull(message = "启用状态不能为空",groups = {UpdateGroup.class, InsertGroup.class})
    private Boolean enable;

    @ApiModelProperty(value = "商品分类")
    @NotBlank(message = "商品分类不能为空",groups = {UpdateGroup.class, InsertGroup.class})
    private String categoryId;

    @ApiModelProperty(value = "展示在介绍上")
    @NotNull(message = "展示在介绍上不能为空",groups = {UpdateGroup.class, InsertGroup.class})
    private Boolean showDesc;
}
